﻿using NUnit.Framework;

namespace CsvImporter.Test
{
  [TestFixture]
  public class TestByCommaSplitter
  {
    [Test]
    public void OneItem()
    {
      var result = "abc".SplitByComma();
      var expected = new[]
                       {
                         "abc",
                       };

      Assert.That(result, Is.EqualTo(expected));
    }

    [Test]
    public void FourItems()
    {
      var result = @"abc,33333,""jklj"",ßßßßß".SplitByComma();
      var expected = new[]
                       {
                         "abc",
                         "33333",
                         @"""jklj""",
                         "ßßßßß",
                       };

      Assert.That(result, Is.EqualTo(expected));
    }

    [Test]
    public void EmptyString()
    {
      var result = "".SplitByComma();
      var expected = new [] {""};

      Assert.That(result, Is.EqualTo(expected));
    }

  }
}
